package com.tencent.xinyapayface.util;

import android.content.Context;
import android.content.pm.PackageManager;

/**
 * Created by zhangjiebo on 2019/9/4.
 *
 * @author ZhangJieBo
 */
public class AppInstalledUtil {
    public static boolean isAppInstalled(Context context, String uri) {

        PackageManager pm = context.getPackageManager();

        boolean installed = false;

        try {

            pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);

            installed = true;

        } catch (PackageManager.NameNotFoundException e) {

            installed = false;

        }

        return installed;

    }
}
